#include <iostream>
#include <algorithm>
using namespace std;
int n,m;
int main()
{
	cin>>n>>m;
	string s1,s2;
	cin>>s1>>s2;
	sort(s2.begin(),s2.end());
	int i=0,j=0;
	while(1)
	{
		if(i==n&&j==m)break;
		if(i==n)printf("%c",s2[j++]);
		else if(j==m)printf("%c",s1[i++]);
		else if(s1[i]<=s2[j])printf("%c",s1[i++]);
		else printf("%c",s2[j++]);
	}
	return 0; 
}
